//Wed Jun 30 18:26:30 CDT 2010
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class RouteIntersection
{
public:
	string isValid(int N, vector<int> coords, string moves)
	{
		map<int, int> index;
		set<map<int, int> > v;
		for (int i = 0; i < coords.size(); i++)
		{
			index[coords[i] - 1] = 0;
		}
		v.insert(index);
		for (int i = 0; i < coords.size(); i++)
		{
			int sz = v.size();
			index[coords[i] - 1] += moves[i] == '+' ? 1 : -1;
			v.insert(index);
			if (sz == (int) v.size())
				return "NOT VALID";
		}
		return "VALID";
	}
};
